package com.cheyunkeji.er.app;

import android.content.Context;

/**
 * Created by Michael on 2017/4/20 14:33.
 */

public class GlobalConfig extends MyPreferencesManager {

//    是否第一次
    private static final String IS_FIRST_START_APP = "first_start_app" ;
    private static final String FILE_NAME = "global_config";
    private static final String IS_LOGIN = "is_login" ;
    private static GlobalConfig sInstance = null;

    public GlobalConfig(Context context) {
        super(context, FILE_NAME);
    }

    public static GlobalConfig getInstance(Context context) {
        synchronized (GlobalConfig.class) {
            if (sInstance == null) {
                sInstance = new GlobalConfig(context);
            }
        }
        return sInstance;
    }

    public void setFirstStartApp(boolean isFirstStart ){

        putBool( IS_FIRST_START_APP , isFirstStart );
    }

    public boolean isFirstStartApp(){

        return getBool(IS_FIRST_START_APP , true);
    }

    public boolean getLogin(){
       return getBool(IS_LOGIN , false);
    }

    public void setLogined(boolean isLogined){
        putBool(IS_LOGIN , isLogined );
    }

}
